-
-
Notifications
You must be signed in to change notification settings - Fork 12
Use template "Check Shell" workflow (Task) #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #214 +/- ##
=======================================
Coverage 87.97% 87.97%
=======================================
Files 43 43
Lines 4176 4176
=======================================
Hits 3674 3674
Misses 391 391
Partials 111 111
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
We have created a standardized `.editorconfig` file that can be used in any Arduino Tooling project: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/general/.editorconfig
The preferred approach is for the tasks to install their specific dependencies as needed, in a manner that does not pollute the task user's environment. However, it doesn't appear to be feasible to do this with the shfmt and ShellCheck tools used by the `shell:format` task, so the task user is responsible for installing this tool. In the event the task user does not have such a tool installed (or installation not in PATH), the task should provide a helpful error message, which is provided by this change.
This is the standardized shell script formatting style to be used in all Arduino Tooling projects, as defined in `/.editorconfig`.
- Use standardized task name - Add support for arbitrary file extensions and path configurations (which is not possible with the previous globstar approach)
GitHub Actions provides a paths filter feature that allows you to restrict workflow run triggers to changes to specific paths within the repository. This can greatly improve the efficiency of the CI system by avoiding running irrelevant checks. The effective use of this feature requires that the purpose of a workflow be focused on a specific type of file or project component. Since collecting related jobs into a single workflow can be the best approach both from a maintainer and contributor viewpoint, it makes sense to do this grouping based on component type rather than on category of operation, as was previously done by the "Check formatting" workflow. The "Check Shell" workflow is collects the linting and formatting checks specific to the project's Shell script files.
Since Windows doesn't have the concept of an executable file mode, and shell scripts not considered executable by Linux, etc. will work fine if a shell is installed (e.g., Git Bash), shell scripts written or worked on by Windows developers may not be executable. For this reason, it is especially helpful for the CI to do a check on the file mode of the project's shell scripts, failing if they are not executable.
The `shell:check-formatting` task has no value to the developer, since they will be better off to just run the formatting task. The CI also doesn't make use of this task, instead taking the superior approach of running the formatting task and then checking for a diff. Since there is no use for this task, it should be removed.
silvanocerza
approved these changes
Jul 30, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Source:
https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-shell-task.md
Note: the "ShellCheck" CI job failure is expected and results from a pre-existing issue in the installation script. I will fix that in a subsequent PR when I sync the installation script from the template one.